package com.yc.game.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yc.game.dao.TrainingVoMapper;
import com.yc.game.service.TrainingVoService;
import com.yc.game.vo.TrainingVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TrainingVoServiceImpl implements TrainingVoService {
    @Autowired
    private TrainingVoMapper trainingVoMapper;

    @Override
    public PageInfo<TrainingVo> getByEmail(Integer pageNum, Integer pageSize, String email) {
        PageHelper.startPage(pageNum, pageSize);
        List<TrainingVo> trainingVos = trainingVoMapper.getByEmail(email);
        PageInfo<TrainingVo> pageInfo = new PageInfo<>(trainingVos);
        return pageInfo;
    }
}
